package www.wen.com.common.lib.view

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import androidx.databinding.DataBindingUtil
import www.wen.com.common.R
import www.wen.com.common.databinding.ItemHeaderBinding

class HeaderItem @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null
) : RelativeLayout(context, attrs) {
    private val binding: ItemHeaderBinding?

    init {
        val view = LayoutInflater.from(context).inflate(R.layout.item_header, this, false)
        addView(view)
        binding = DataBindingUtil.bind(view)
    }

    var title: String = ""
        set(value) {
            binding?.itemText?.text = value
            field = value
        }

}